]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: Only set the label's text when initially showing the label
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 3 Oct 2012 05:22:46 +0000 (02:22 -0300)
committerJasper St. Pierre <jstpierre@mecheye.net>
Sat, 6 Oct 2012 19:07:55 +0000 (16:07 -0300)
Having the tooltip change when it's visible looks strange and glitchy.
This also makes sure that "Remove from Favorites" doesn't change, even
when the user removes their mouse cursor from it.

https://bugzilla.gnome.org/show_bug.cgi?id=685313

js/ui/dash.js

index 215bd6f351adf38c9e5afee2c88b40b354aecf47..dc08b68ab53a30a0a9ff11647d497a81ad3c9d1c 100644 (file)
@@ -48,6 +48,7 @@ const DashItemContainer = new Lang.Class({
                            Lang.bind(this, this._allocate));
         this.actor._delegate = this;
 
+        this._labelText = "";
         this.label = new St.Label({ style_class: 'dash-label'});
         this.label.hide();
         Main.layoutManager.addChrome(this.label);
@@ -106,6 +107,10 @@ const DashItemContainer = new Lang.Class({
     },
 
     showLabel: function() {
+        if (!this._labelText)
+            return;
+
+        this.label.set_text(this._labelText);
         this.label.opacity = 0;
         this.label.show();
 
@@ -136,7 +141,7 @@ const DashItemContainer = new Lang.Class({
     },
 
     setLabelText: function(text) {
-        this.label.set_text(text);
+        this._labelText = text;
     },
 
     hideLabel: function () {